<?php
error_reporting("E_ALL");ini_set("display_errors", 1);
$getdata=$_REQUEST;
if(empty($getdata))$getdata=$_POST?$_POST:$_GET;
$type=empty($getdata['type'])?'':$getdata['type'];
include("include/function.php");
//header("content-Type: application/json; charset=utf-8");
$config = include("config.php");
include("include/".$config['DB_TYPE'].".class.php");
$db = new db;
$db->connect($config['DB_HOST'],$config['DB_USER'],$config['DB_PWD'],$config['DB_NAME'], $config['DB_PCONNECT']);

$sql = "select class_id,school_id,name,nickname from hema_school_class where status=1";
$list = $db->get_all($sql);
$class=[];
foreach($list as $v){
    $class[$v['school_id']][$v['name']]=$v['class_id'];
    if($v['name']!=$v['nickname'])$class[$v['school_id']][$v['nickname']]=$v['class_id'];
}
var_export($class);

?>